home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / tcl / tests / README < prev    next >
Text File  |  1992-11-06  |  3KB  |  90 lines

  1. Tcl Test Suite
  2. --------------
  3.  
  4. This directory contains a set of validation tests for the Tcl
  5. commands.  Each of the files whose name ends in ".test" is
  6. intended to fully exercise one or a few Tcl commands.  The
  7. commands tested by a given file are listed in the first line
  8. of the file.
  9.  
  10. The simplest way to run a test is to start up tclTest in this
  11. directory and "source" the test file (for example, type "source
  12. parse.test").  To run all of the tests, type "source all".  If
  13. all goes well then no output will appear.  If there are errors
  14. then messages will appear in the format described below.
  15.  
  16. The rest of this file provides additional information on the
  17. features of the testing environment.
  18.  
  19. This approach to testing was designed and initially implemented
  20. by Mary Ann May-Pumphrey of Sun Microsystems.  Many thanks to
  21. her for donating her work back to the public Tcl release.
  22.  
  23. Definitions file:
  24. -----------------
  25.  
  26. The file "defs" defines a collection of procedures and variables
  27. used to run the tests.  It is read in automatically by each of the
  28. .test files if needed, but once it has been read once it will not
  29. be read again by the .test files.  If you change defs while running
  30. tests you'll have to "source" it by hand to load its new contents.
  31.  
  32. Test output:
  33. ------------
  34.  
  35. Normally, output only appears when there are errors.  However, if
  36. the variable VERBOSE is set to 1 then tests will be run in "verbose"
  37. mode and output will be generated for each test regardless of
  38. whether it succeeded or failed.  Test output consists of the
  39. following information:
  40.  
  41.     - the test identifier (which can be used to locate the test code
  42.         in the .test file)
  43.     - a brief description of the test
  44.     - the contents of the test code
  45.     - the actual results produced by the tests
  46.     - a "PASSED" or "FAILED" message
  47.     - the expected results (if the test failed)
  48.  
  49. You can set VERBOSE either interactively (after the defs file has been
  50. read in), or you can change the default value in "defs".
  51.  
  52. Selecting tests for execution:
  53. ------------------------------
  54.  
  55. Normally, all the tests in a file are run whenever the file is
  56. "source"d.  However, you can select a specific set of tests using
  57. the global variable TESTS.  This variable contains a pattern;  any
  58. test whose identifier matches TESTS will be run.  For example,
  59. the following interactive command causes all of the "for" tests in
  60. groups 2 and 4 to be executed:
  61.  
  62.     set TESTS {for-[24]*}
  63.  
  64. TESTS defaults to *, but you can change the default in "defs" if
  65. you wish.
  66.  
  67. Saving keystrokes:
  68. ------------------
  69.  
  70. A convenience procedure named "dotests" is included in file
  71. "defs".  It takes two arguments--the name of the test file (such
  72. as "parse.test"), and a pattern selecting the tests you want to
  73. execute.  It sets TESTS to the second argument, calls "source" on
  74. the file specified in the first argument, and restores TESTS to
  75. its pre-call value at the end.
  76.  
  77. Batch vs. interactive execution:
  78. --------------------------------
  79.  
  80. The tests can be run in either batch or interactive mode.  Batch
  81. mode refers to using I/O redirection from a UNIX shell.  For example,
  82. the following command causes the tests in the file named "parse.test"
  83. to be executed:
  84.  
  85.     tclTest < parse.test > parse.test.results
  86.  
  87. Users who want to execute the tests in this fashion need to first
  88. ensure that the file "defs" has proper values for the global
  89. variables that control the testing environment (VERBOSE and TESTS).
  90.